package org.budo.mongo.wrapper;

import java.util.Collection;
import java.util.List;

import org.budo.mongo.filter.MongoFilter;
import org.budo.mongo.filter.MongoFilterChain;
import org.budo.mongo.filter.MongoFilterChainImpl;

import com.mongodb.CommandResult;
import com.mongodb.DB;
import com.mongodb.DBObject;
import com.mongodb.MongoClient;
import com.mongodb.MongoClientOptions;
import com.mongodb.MongoOptions;
import com.mongodb.ReadConcern;
import com.mongodb.ReadPreference;
import com.mongodb.ReplicaSetStatus;
import com.mongodb.ServerAddress;
import com.mongodb.WriteConcern;
import com.mongodb.client.ListDatabasesIterable;
import com.mongodb.client.MongoDatabase;
import com.mongodb.client.MongoIterable;

@SuppressWarnings({ "deprecation", "unchecked", "rawtypes" })
public class MongoClientWrapper extends MongoClient {
    private MongoClient mongoClient;

    private MongoFilterChain filterChain;

    public MongoClientWrapper(List<MongoFilter> filters, MongoClient mongoClient) {
        this.filterChain = new MongoFilterChainImpl(filters);
        this.mongoClient = mongoClient;
    }

    @Override
    public void addOption(int $0) {
        filterChain.mongoClient_addOption(this.mongoClient, $0);
    }

    @Override
    public void close() {
        filterChain.mongoClient_close(this.mongoClient);
    }

    @Override
    public void dropDatabase(String $0) {
        filterChain.mongoClient_dropDatabase(this.mongoClient, $0);
    }

    @Override
    public CommandResult fsync(boolean $0) {
        return filterChain.mongoClient_fsync(this.mongoClient, $0);
    }

    @Override
    public CommandResult fsyncAndLock() {
        return filterChain.mongoClient_fsyncAndLock(this.mongoClient);
    }

    @Override
    public ServerAddress getAddress() {
        return filterChain.mongoClient_getAddress(this.mongoClient);
    }

    @Override
    public List getAllAddress() {
        return filterChain.mongoClient_getAllAddress(this.mongoClient);
    }

    @Override
    public String getConnectPoint() {
        return filterChain.mongoClient_getConnectPoint(this.mongoClient);
    }

    @Override
    public List getCredentialsList() {
        return filterChain.mongoClient_getCredentialsList(this.mongoClient);
    }

    @Override
    public DB getDB(String $0) {
        return filterChain.mongoClient_getDB(this.mongoClient, $0);
    }

    @Override
    public MongoDatabase getDatabase(String $0) {
        return filterChain.mongoClient_getDatabase(this.mongoClient, $0);
    }

    @Override
    public List getDatabaseNames() {
        return filterChain.mongoClient_getDatabaseNames(this.mongoClient);
    }

    @Override
    public int getMaxBsonObjectSize() {
        return filterChain.mongoClient_getMaxBsonObjectSize(this.mongoClient);
    }

    @Override
    public MongoClientOptions getMongoClientOptions() {
        return filterChain.mongoClient_getMongoClientOptions(this.mongoClient);
    }

    @Override
    public MongoOptions getMongoOptions() {
        return filterChain.mongoClient_getMongoOptions(this.mongoClient);
    }

    @Override
    public int getOptions() {
        return filterChain.mongoClient_getOptions(this.mongoClient);
    }

    @Override
    public ReadConcern getReadConcern() {
        return filterChain.mongoClient_getReadConcern(this.mongoClient);
    }

    @Override
    public ReadPreference getReadPreference() {
        return filterChain.mongoClient_getReadPreference(this.mongoClient);
    }

    @Override
    public ReplicaSetStatus getReplicaSetStatus() {
        return filterChain.mongoClient_getReplicaSetStatus(this.mongoClient);
    }

    @Override
    public List getServerAddressList() {
        return filterChain.mongoClient_getServerAddressList(this.mongoClient);
    }

    @Override
    public Collection getUsedDatabases() {
        return filterChain.mongoClient_getUsedDatabases(this.mongoClient);
    }

    @Override
    public WriteConcern getWriteConcern() {
        return filterChain.mongoClient_getWriteConcern(this.mongoClient);
    }

    @Override
    public boolean isLocked() {
        return filterChain.mongoClient_isLocked(this.mongoClient);
    }

    @Override
    public MongoIterable listDatabaseNames() {
        return filterChain.mongoClient_listDatabaseNames(this.mongoClient);
    }

    @Override
    public ListDatabasesIterable listDatabases(Class $0) {
        return filterChain.mongoClient_listDatabases(this.mongoClient, $0);
    }

    @Override
    public ListDatabasesIterable listDatabases() {
        return filterChain.mongoClient_listDatabases(this.mongoClient);
    }

    @Override
    public void resetOptions() {
        filterChain.mongoClient_resetOptions(this.mongoClient);
    }

    @Override
    public void setOptions(int $0) {
        filterChain.mongoClient_setOptions(this.mongoClient, $0);
    }

    @Override
    public void setReadPreference(ReadPreference $0) {
        filterChain.mongoClient_setReadPreference(this.mongoClient, $0);
    }

    @Override
    public void setWriteConcern(WriteConcern $0) {
        filterChain.mongoClient_setWriteConcern(this.mongoClient, $0);
    }

    @Override
    public void slaveOk() {
        filterChain.mongoClient_slaveOk(this.mongoClient);
    }

    @Override
    public String toString() {
        return filterChain.mongoClient_toString(this.mongoClient);
    }

    @Override
    public DBObject unlock() {
        return filterChain.mongoClient_unlock(this.mongoClient);
    }

}